﻿/*------------------------------------------------
// File Description: Warehouse DataBase Entity
// Author:			 汪亮
// Create Time:		 2020-03-09 16:44:50
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using IOA.MES.DataAccess.Enum;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 仓库表
    /// </summary>
    [Table(nameof(Warehouse))]
    public class Warehouse : BaseEntity
    {
        private string _warehouseCode = string.Empty;
        private string _warehouseName = string.Empty;
        private string _workshopCode;
        private string _workshopName;

        #region Public Property

        ///<Summary>
        /// 仓库类型（0：物料仓，1：线边仓，2：成品仓）
        ///</Summary>
        public Enum.WarehouseType WarehouseType { get; set; }

        ///<Summary>
        /// 仓库代码
        ///</Summary>
        public string WarehouseCode
        {
            get { return string.IsNullOrWhiteSpace(_warehouseCode) ? string.Empty : _warehouseCode; }
            set { _warehouseCode = value; }
        }

        ///<Summary>
        /// 仓库名称
        ///</Summary>
        public string WarehouseName
        {
            get { return string.IsNullOrWhiteSpace(_warehouseName) ? string.Empty : _warehouseName; }
            set { _warehouseName = value; }
        }

        ///<Summary>
        /// 车间代码
        ///</Summary>
        public string WorkshopCode
        {
            get { return string.IsNullOrWhiteSpace(_workshopCode) ? string.Empty : _workshopCode; }
            set { _workshopCode = value; }
        }

        ///<Summary>
        /// 车间名称
        ///</Summary>
        public string WorkshopName
        {
            get { return string.IsNullOrWhiteSpace(_workshopName) ? string.Empty : _workshopName; }
            set { _workshopName = value; }
        }

        /// <summary>
        /// 仓库状态
        /// </summary>
        public CommonStatus Status { get; set; }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 仓库表
        /// </summary>
        public virtual DbSet<Warehouse> Warehouses { get; set; }
    }
}